ci: Add a static analysis job
authorEmmanuele Bassi <ebassi@gnome.org>
Tue, 25 Feb 2020 19:06:39 +0000 (19:06 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Tue, 25 Feb 2020 19:06:39 +0000 (19:06 +0000)
Use the Clang static analysis tool.

For the time being, we're going to allow it to fail, but the plan is to
fix every issue it raises.

.gitlab-ci.yml

index 1166c50f2efe0214196baec4418e1e1c877d07dd..c497040add06ce97ece16b3cd2cb866793e3acf3 100644 (file)
@@ -1,5 +1,6 @@
 stages:
   - build
+  - analysis
   - docs
   - flatpak
   - deploy
@@ -166,13 +167,26 @@ flatpak-master:icon-browser:
     APPID: org.gtk.IconBrowser4
   <<: *flatpak-master
 
+static-scan:
+  image: registry.gitlab.gnome.org/gnome/gtk/fedora:v14
+  stage: analysis
+  variables:
+    EXTRA_MESON_FLAGS: "--buildtype=debug"
+  script:
+    - meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} _scan_build
+    - ninja -C _scan_build scan-build
+  artifacts:
+    paths:
+      - _scan_build/meson-logs
+  allow_failure: true
+
 reference:
   image: registry.gitlab.gnome.org/gnome/gtk/fedora:v14
   stage: docs
   variables:
     EXTRA_MESON_FLAGS: "--buildtype=release"
   script:
-    - meson ${COMMON_MESON_FLAGS} -Dgtk_doc=true _build
+    - meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} -Dgtk_doc=true _build
     - ninja -C _build gdk4-doc gsk4-doc gtk4-doc
     - mkdir -p _reference/
     - mv _build/docs/reference/gdk/html/ _reference/gdk/